<script setup>

//定义一个属性

let props = defineProps(['money',"books"]);

//
defineProps({
  money: Number

})

function buy(){
  emits('buy',-5)
}

//
let emits = defineEmits(['buy']);
</script>

<template>

  <div style="background-color: aqua">
    <h3 >son</h3>
    <div>账户:{{props.money}}</div>
    <div>图书:
      <li v-for="b in props.books"> {{b}}</li>
    </div>
    <button @click="buy">买</button>
  </div>
</template>

<style scoped>

</style>